<?php

if (isset($_GET['id']))
	$uid = $_GET['id'];
else
	$uid = $_SESSION['uid'];

$infos = get_user_infos_3($uid);

if (@$_POST['action'] == "edit_pic")
{
	$get_result = edit_picture($_SESSION['uid']);
	if ( $get_result == 0)
	{
		add_history($_SESSION['uid'], 1, "", "");
		redirect("profil.php", 1);
	}
}

$ulogin = get_login($uid);
$image = "data/avatars/$ulogin.jpg";
if (!file_exists($image))
	$image = $_SESSION['current_path']."/images/avatar.png";

$nb_groups = get_nb_groups($uid);
$maxg = 5;
$maxa = 15;
$maxn = 8;

Print("
	<table cellspacing=3 border=0 width=100%>
		<tr>
			<td valign=top>
				<img src=\"$image\" width=100 height=75><br>");
				if (($uid == $_SESSION['uid']) && (@$_GET['action'] == "edit"))
					Print("<small><a href=\"ipage.php?height=110&action=modif_pic\" title=\"<b><font color=royalblue>Modifier ma photo du profil</font></b>\" class=\"thickbox\">Modifier ma photo <img src=\"$_SESSION[current_path]/images/picture_edit.png\" width=13 height=13></a></small>");
			Print("</td>
			<td valign=top width=90%>
				<h1 style=\"color: #4B4B4B;\">$infos[first] $infos[last]</h1>
			</td>
		</tr>
	</table>
	<br>
");

?>